package com.lagou.homework2.no3;

/**
 * 通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息
 */
public class TalkPackage extends TalkAndInternet implements PhoneServiceInterface{
    //通话时长
    private int talkTime;
    //短信条数
    private int smsNum;
    //无参构造器
    public TalkPackage() {
    }

    //有参构造器
    public TalkPackage(int talkTime, int smsNum, String monthlyCharges) {
        super(monthlyCharges);
        this.talkTime = talkTime;
        this.smsNum = smsNum;
    }

    public int getTalkTime() {
        return talkTime;
    }

    public void setTalkTime(int talkTime) {
        this.talkTime = talkTime;
    }

    public int getSmsNum() {
        return smsNum;
    }

    public void setSmsNum(int smsNum) {
        this.smsNum = smsNum;
    }

    //行为
    public void show(int talk,String monthly){
        System.out.println("通话时长："+talk+",每月资费："+monthly);

    }

    @Override
    public void method1(int talktime, IcCards icCards) {
        setTalkTime(talktime);
        setMonthlyCharges("卡号："+icCards.getCardNum()+",上网流量："+icCards.getInternetTraffic()+",通话时长："+icCards.getTalkTime()+"。");
        show(this.talkTime,this.getMonthlyCharges());
    }
}
